package com.sky.mapper;/**
 * @ProjectName: sky-take-out
 * @Package: com.sky.mapper
 * @ClassName: CategoryMapper
 * @Author: 王加其
 * @Date: 2023/4/16 8:44
 * @Version: 1.0
 */

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 *@author:王加其
 *@date:2023/4/16 8:44
 *@modified By:
 **/
@Mapper
public interface CategoryMapper {
    /**
     * 分类页面查询
     * @param categoryPageQueryDTO
     * @return
     */
    Page<Category> pageQuery(CategoryPageQueryDTO categoryPageQueryDTO);

    /**
     * 新增分类
     * @param category
     */
    @AutoFill(value = OperationType.INSERT)
    void insert(Category category);

    /**
     * 根据id删除分类
     * @param id
     */
    void deleteById(Long id);

    /**
     * 根据id修改分类
     * @param category
     */
    @AutoFill(value = OperationType.UPDATE)
    void update(Category category);

    /**
     * 根据类型查询分类
     * @param type
     * @return
     */
    List<Category> list(Integer type);
}
